package com.hwz.gulimall.search.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: hwz
 * @CreateTime: 2025-07-06
 */

@Configuration
public class EsConfig {
    @Bean
    public RestHighLevelClient restHighLevelClient(){

        RestClientBuilder builder = RestClient.builder(new HttpHost("192.168.150.101", 9200));

        return new RestHighLevelClient(builder);
    }
}
